//
//  FontSizeController.m
//  iPadDev01
//
//  Created by smu on 11-7-30.
//  Copyright 2011年 duk. All rights reserved.
//

#import "FontSizeController.h"


@implementation FontSizeController
@synthesize font;

// Implement viewDidLoad to do additional setup after loading the view
//typically from a nib
- (void)viewDidLoad
{
    [super viewDidLoad];
    textView.font = self.font;
    NSInteger i = self.font.pointSize;
    label.text = [NSString stringWithFormat:@"%d",i];
    slider.value = i;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
	return YES;
}

- (void)dealloc
{
    self.font = nil;
    [super dealloc];
}

- (void)takeIntValueFrom:(id)sender
{
    NSInteger size = ((UISlider *)sender).value;
    self.font = [self.font fontWithSize:size];
    textView.font = self.font;
    label.text = [NSString stringWithFormat:@"%d",size];
}

@end
